<?php
/*
+-----------------------------------------------------------------------------+
| $Id: *.php,v 1.* 2005/07/01 06:15:08 Bleakwind Exp $
| SnowStats
|         --- A Web Statistics Analysis for multiuser
| Copyright (c) 2003-2005 Weaverdream.com By Bleakwind
| http://www.weaverdream.com
+-----------------------------------------------------------------------------+
*/

include_once 'include/include.php';
include_once 'include/header.php';
?>

<table width="760" border="0" cellpadding="0" cellspacing="0" bgcolor="#5E94DD" align="center">
  <tr bgcolor="#5E94DD">
    <td width="200" align="center" valign="top" class="left_bg">
      <?include_once 'include/menu.php';?>
    </td>
    <td width="560" bgcolor="#FFFFFF" valign="top">

<?php
if( CONFIG_IFUSER != "y" && if_adminlogin() != "y"){
   header("location:prompt.php?act=failed&url=index.php&mes=".htmlentities(urlencode($LANGUAGE['register_closed'])));
   exit;
}

if(empty($_GET['act'])){?>

<table width="100%" border="0" cellspacing="0" cellpadding="3" align="center" bgcolor="#EBE9ED"><tr><td><img src="images/arrowright.gif" border=0 align="absmiddle"> <a href="index.php" target="_self"><font style="color:#000000;"><?php echo CONFIG_WEBSITE;?></font></a> &raquo; <?php echo $LANGUAGE['register_place'];?></td></tr></table>
<br>
<table width="95%" border="0" cellspacing="0" cellpadding="0" align="center">
<form action="register.php?act=save" method="post" name="form">
<tr><td>

<table width="100%" border="0" cellspacing="1" cellpadding="3" align="center" bgcolor="#FFFFFF">
  <tr><td colspan="3" class="right_title"><?php echo $LANGUAGE['register_profileinfo'];?></td></tr>
  <tr><td width="20%" class="right_subject"><?php echo $LANGUAGE['register_username'];?></td><td width="40%" class="right_content"><input type="text" name="username" size="26" maxlength="60" class="input"></td><td width="40%" class="right_content"><?php echo $LANGUAGE['register_username_explain'];?></td></tr>
  <tr><td width="20%" class="right_subject"><?php echo $LANGUAGE['register_password'];?></td><td width="40%" class="right_content"><input type="password" name="password1" size="26" maxlength="60" class="input"></td><td width="40%" class="right_content"><?php echo $LANGUAGE['register_password_explain'];?></td></tr>
  <tr><td width="20%" class="right_subject"><?php echo $LANGUAGE['register_confirm_password'];?></td><td width="40%" class="right_content"><input type="password" name="password2" size="26" maxlength="60" class="input"></td><td width="40%" class="right_content"><?php echo $LANGUAGE['register_confirm_password_explain'];?></td></tr>
  <tr><td width="20%" class="right_subject"><?php echo $LANGUAGE['register_email'];?></td><td width="40%" class="right_content"><input type="text" name="email" size="26" maxlength="160" class="input"></td><td width="40%" class="right_content"></td></tr>
  <tr><td width="20%" class="right_subject"><?php echo $LANGUAGE['register_website'];?></td><td width="40%" class="right_content"><input type="text" name="website" size="26" maxlength="160" class="input"></td><td width="40%" class="right_content"></td></tr>
  <tr><td width="20%" class="right_subject"><?php echo $LANGUAGE['register_weburl'];?></td><td width="40%" class="right_content"><input type="text" name="weburl" size="26" maxlength="160" value="http://" class="input"></td><td width="40%" class="right_content"></td></tr>
  <tr><td width="20%" class="right_subject"><?php echo $LANGUAGE['register_webintro'];?></td><td width="40%" class="right_content"><textarea name="webintro" rows="6" cols="26" class="textarea"></textarea></td><td width="40%" class="right_content"><?php echo sprintf($LANGUAGE['register_webintro_explain'],CONFIG_WEBINTRO_LONG);?></td></tr>
</table>

<table width="100%" border="0" cellspacing="1" cellpadding="3" align="center" bgcolor="#FFFFFF">
  <tr><td colspan="3" class="right_title"><?php echo $LANGUAGE['register_config'];?></td></tr>
  <tr><td width="20%" class="right_subject"><?php echo $LANGUAGE['register_length'];?></td><td width="40%" class="right_content"><input type="text" name="length" size="26" maxlength="2" value="9" class="input"></td><td width="40%" class="right_content"><?php echo $LANGUAGE['register_length_explain'];?></td></tr>
  <tr><td width="20%" class="right_subject"><?php echo $LANGUAGE['register_timediff'];?></td><td width="40%" class="right_content"><input type="text" name="timediff" size="26" maxlength="2" value="0" class="input"> hr.</td><td width="40%" class="right_content"><?php echo sprintf($LANGUAGE['register_timediff_explain'],date('Y-m-d H'));?></td></tr>
  <tr><td width="20%" class="right_subject"><?php echo $LANGUAGE['register_ifview'];?></td><td width="40%" class="right_content"><input type="radio" name="ifview" value="y" checked class="radio_y">&nbsp;<?php echo $LANGUAGE['register_yes'];?>&nbsp;<input type="radio" name="ifview" value="n" class="radio_n">&nbsp;<?php echo $LANGUAGE['register_no'];?></td><td width="40%" class="right_content"><?php echo $LANGUAGE['register_ifview_explain'];?></td></tr>
  <tr><td width="20%" class="right_subject"><?php echo $LANGUAGE['register_ifadd0'];?></td><td width="40%" class="right_content"><input type="radio" name="ifadd0" value="y" class="radio_y">&nbsp;<?php echo $LANGUAGE['register_yes'];?>&nbsp;<input type="radio" name="ifadd0" value="n" checked class="radio_n">&nbsp;<?php echo $LANGUAGE['register_no'];?></td><td width="40%" class="right_content"><?php echo $LANGUAGE['register_ifadd0_explain'];?></td></tr>
  <tr>
    <td width="20%" class="right_subject"><?php echo $LANGUAGE['register_language'];?></td>
    <td width="40%" class="right_content">
<?php
$file_list     = return_dir("language/");
$total_record = count($file_list);
echo "<select name='language' class='select' size=1>";
echo "<option value='".CONFIG_LANGUAGE."'>".CONFIG_LANGUAGE."</option>";
for($i=0;$i<$total_record;$i++){
  if(trim($file_list[$i]) != CONFIG_LANGUAGE){
      echo "<option value='".$file_list[$i]."'>".$file_list[$i]."</option>";
  }
}
echo "</select>";
?>
    </td>
    <td width="40%" class="right_content"><?php echo $LANGUAGE['register_language_explain'];?></td>
  </tr>
</table>

<table width="100%" border="0" cellspacing="1" cellpadding="3" align="center" bgcolor="#FFFFFF">
  <tr><td colspan="6" align="center" class="right_title"><?php echo $LANGUAGE['register_output_format'];?></td></tr>
  <tr align="center">                     
    <td width="15%" rowspan="2" class="right_subject"><?php echo $LANGUAGE['register_output_total'];?></td>
    <td width="10%" class="right_subject"><?php echo $LANGUAGE['register_output_ip'];?></td>
    <td width="15%" class="right_subject2"><?php echo $LANGUAGE['register_output_ifshow'];?></td>
    <td width="25%" class="right_content"><input type="radio" name="total_ip_if" value="y" checked class="radio_y"> <?php echo $LANGUAGE['register_output_show'];?> <input type="radio" name="total_ip_if" value="n" class="radio_n"> <?php echo $LANGUAGE['register_output_hidden'];?></td>
    <td width="10%" class="right_subject2"><?php echo $LANGUAGE['register_output_prefix'];?></td>
    <td width="25%" class="right_content"><textarea name="total_ip_text" rows="2" cols="20" class="textarea"> <?php echo $LANGUAGE['register_output_value_totalip'];?></textarea></td>
  </tr>                                   
  <tr align="center">                     
    <td width="10%" class="right_subject"><?php echo $LANGUAGE['register_output_ip'];?></td>
    <td width="15%" class="right_subject2"><?php echo $LANGUAGE['register_output_ifshow'];?></td>
    <td width="25%" class="right_content"><input type="radio" name="total_pv_if" value="y" checked class="radio_y"> <?php echo $LANGUAGE['register_output_show'];?> <input type="radio" name="total_pv_if" value="n" class="radio_n"> <?php echo $LANGUAGE['register_output_hidden'];?></td>
    <td width="10%" class="right_subject2"><?php echo $LANGUAGE['register_output_prefix'];?></td>
    <td width="25%" class="right_content"><textarea name="total_pv_text" rows="2" cols="20" class="textarea"> <?php echo $LANGUAGE['register_output_value_totalpv'];?></textarea></td>
  </tr>                                   
  <tr align="center">                     
    <td width="15%" rowspan="2" class="right_subject"><?php echo $LANGUAGE['register_output_year'];?></td>
    <td width="10%" class="right_subject"><?php echo $LANGUAGE['register_output_ip'];?></td>
    <td width="15%" class="right_subject2"><?php echo $LANGUAGE['register_output_ifshow'];?></td>
    <td width="25%" class="right_content"><input type="radio" name="year_ip_if" value="y" class="radio_y"> <?php echo $LANGUAGE['register_output_show'];?> <input type="radio" name="year_ip_if" value="n" checked class="radio_n"> <?php echo $LANGUAGE['register_output_hidden'];?></td>
    <td width="10%" class="right_subject2"><?php echo $LANGUAGE['register_output_prefix'];?></td>
    <td width="25%" class="right_content"><textarea name="year_ip_text" rows="2" cols="20" class="textarea"> <?php echo $LANGUAGE['register_output_value_thisyearip'];?></textarea></td>
  </tr>                                   
  <tr align="center">                     
    <td width="10%" class="right_subject"><?php echo $LANGUAGE['register_output_ip'];?></td>
    <td width="15%" class="right_subject2"><?php echo $LANGUAGE['register_output_ifshow'];?></td>
    <td width="25%" class="right_content"><input type="radio" name="year_pv_if" value="y" class="radio_y"> <?php echo $LANGUAGE['register_output_show'];?> <input type="radio" name="year_pv_if" value="n" checked class="radio_n"> <?php echo $LANGUAGE['register_output_hidden'];?></td>
    <td width="10%" class="right_subject2"><?php echo $LANGUAGE['register_output_prefix'];?></td>
    <td width="25%" class="right_content"><textarea name="year_pv_text" rows="2" cols="20" class="textarea"> <?php echo $LANGUAGE['register_output_value_thisyearpv'];?></textarea></td>
  </tr>                                   
  <tr align="center">                     
    <td width="15%" rowspan="2" class="right_subject"><?php echo $LANGUAGE['register_output_month'];?></td>
    <td width="10%" class="right_subject"><?php echo $LANGUAGE['register_output_ip'];?></td>
    <td width="15%" class="right_subject2"><?php echo $LANGUAGE['register_output_ifshow'];?></td>
    <td width="25%" class="right_content"><input type="radio" name="month_ip_if" value="y"  class="radio_y"> <?php echo $LANGUAGE['register_output_show'];?> <input type="radio" name="month_ip_if" value="n" checked class="radio_n"> <?php echo $LANGUAGE['register_output_hidden'];?></td>
    <td width="10%" class="right_subject2"><?php echo $LANGUAGE['register_output_prefix'];?></td>
    <td width="25%" class="right_content"><textarea name="month_ip_text" rows="2" cols="20" class="textarea"> <?php echo $LANGUAGE['register_output_value_thismonthip'];?></textarea></td>
  </tr>                                   
  <tr align="center">                     
    <td width="10%" class="right_subject"><?php echo $LANGUAGE['register_output_ip'];?></td>
    <td width="15%" class="right_subject2"><?php echo $LANGUAGE['register_output_ifshow'];?></td>
    <td width="25%" class="right_content"><input type="radio" name="month_pv_if" value="y" class="radio_y"> <?php echo $LANGUAGE['register_output_show'];?> <input type="radio" name="month_pv_if" value="n" checked class="radio_n"> <?php echo $LANGUAGE['register_output_hidden'];?></td>
    <td width="10%" class="right_subject2"><?php echo $LANGUAGE['register_output_prefix'];?></td>
    <td width="25%" class="right_content"><textarea name="month_pv_text" rows="2" cols="20" class="textarea"> <?php echo $LANGUAGE['register_output_value_thismonthpv'];?></textarea></td>
  </tr>                                   
  <tr align="center">                     
    <td width="15%" rowspan="2" class="right_subject"><?php echo $LANGUAGE['register_output_day'];?></td>
    <td width="10%" class="right_subject"><?php echo $LANGUAGE['register_output_ip'];?></td>
    <td width="15%" class="right_subject2"><?php echo $LANGUAGE['register_output_ifshow'];?></td>
    <td width="25%" class="right_content"><input type="radio" name="day_ip_if" value="y"  class="radio_y"> <?php echo $LANGUAGE['register_output_show'];?> <input type="radio" name="day_ip_if" value="n" checked class="radio_n"> <?php echo $LANGUAGE['register_output_hidden'];?></td>
    <td width="10%" class="right_subject2"><?php echo $LANGUAGE['register_output_prefix'];?></td>
    <td width="25%" class="right_content"><textarea name="day_ip_text" rows="2" cols="20" class="textarea"> <?php echo $LANGUAGE['register_output_value_todayip'];?></textarea></td>
  </tr>                                   
  <tr align="center">                     
    <td width="10%" class="right_subject"><?php echo $LANGUAGE['register_output_ip'];?></td>
    <td width="15%" class="right_subject2"><?php echo $LANGUAGE['register_output_ifshow'];?></td>
    <td width="25%" class="right_content"><input type="radio" name="day_pv_if" value="y" class="radio_y"> <?php echo $LANGUAGE['register_output_show'];?> <input type="radio" name="day_pv_if" value="n" checked class="radio_n"> <?php echo $LANGUAGE['register_output_hidden'];?></td>
    <td width="10%" class="right_subject2"><?php echo $LANGUAGE['register_output_prefix'];?></td>
    <td width="25%" class="right_content"><textarea name="day_pv_text" rows="2" cols="20" class="textarea"> <?php echo $LANGUAGE['register_output_value_todaypv'];?></textarea></td>
  </tr>                                   
  <tr align="center">                     
    <td colspan="2" class="right_subject"><?php echo $LANGUAGE['register_output_online'];?></td>
    <td width="15%" class="right_subject2"><?php echo $LANGUAGE['register_output_ifshow'];?></td>
    <td width="25%" class="right_content"><input type="radio" name="online_if" value="y" checked class="radio_y"> <?php echo $LANGUAGE['register_output_show'];?> <input type="radio" name="online_if" value="n" class="radio_n"> <?php echo $LANGUAGE['register_output_hidden'];?></td>
    <td width="10%" class="right_subject2"><?php echo $LANGUAGE['register_output_prefix'];?></td>
    <td width="25%" class="right_content"><textarea name="online_text" rows="2" cols="20" class="textarea"> <?php echo $LANGUAGE['register_output_value_online'];?></textarea></td>
  </tr>                                   
</table>                                  

<table width="100%" border="0" cellspacing="1" cellpadding="3" align="center" bgcolor="#FFFFFF">
  <tr><td colspan="3" align="center" class="right_title"><?php echo $LANGUAGE['register_mode_style'];?></td></tr>
  <tr>
    <td width="20%" class="right_subject"><?php echo $LANGUAGE['register_mode_select'];?></td>
    <td width="40%" class="right_content">
      <select name="mode" class="select"  onChange="for(var i=0; i<options.length; i++){eval(options[i].value).style.display=value==options[i].value?'':'none'}">
      <option value="js"><?php echo $LANGUAGE['register_mode_js'];?></option>
      <option value="image"><?php echo $LANGUAGE['register_mode_image'];?></option>
      </select>
    </td>
    <td width="40%" class="right_content"><?php echo $LANGUAGE['register_mode_select_explain'];?></td>
  </tr>
</table>

<!-- begin js mode -->
<div id="js">

<table width="100%" border="0" cellspacing="1" cellpadding="3" align="center" bgcolor="#FFFFFF">
  <tr>
    <td width="20%" class="right_subject2"><?php echo $LANGUAGE['register_js_select'];?></td>
    <td width="40%" class="right_content">
      <select name="js_style" class="select"  onChange="for(var i=0; i<options.length; i++){eval(options[i].value).style.display=value==options[i].value?'':'none'}">
      <option value="js_text"><?php echo $LANGUAGE['register_js_text'];?></option>
      <option value="js_picture"><?php echo $LANGUAGE['register_js_picture'];?></option>
      <option value="js_icon"><?php echo $LANGUAGE['register_js_icon'];?></option>
      <option value="js_hidden"><?php echo $LANGUAGE['register_js_hidden'];?></option>
      </select>
    </td>
    <td width="40%" class="right_content"><?php echo $LANGUAGE['register_js_select_explain'];?></td>
  </tr>
</table>

<table width="100%" border="0" cellspacing="1" cellpadding="3" align="center" bgcolor="#FFFFFF" id="js_text">
  <tr>
    <td width="20%" class="right_subject2"><?php echo $LANGUAGE['register_js_text_fontfamily'];?></td>
    <td width="40%" class="right_content">
      <select name="js_text_fontfamily" class="select">
      <option value="Arial">Arial</option>
      <option value="Book Antiqua">Book Antiqua</option>
      <option value="Century Gothic">Century Gothic</option>
      <option value="Courier New">Courier New</option>
      <option value="Courier">Courier</option>
      <option value="Geneva">Geneva</option>
      <option value="Georgia">Georgia</option>
      <option value="Helvetica">Helvetica</option>
      <option value="Impact">Impact</option>
      <option value="mono">mono</option>
      <option value="sans-serif">sans-serif</option>
      <option value="serif">serif</option>
      <option value="Tahoma">Tahoma</option>
      <option value="Times New Roman">Times New Roman</option>
      <option value="Times">Times</option>
      <option value="Verdana" selected>Verdana</option>
      </select>
    </td>
    <td width="40%" class="right_content"></td>
  </tr>
  <tr>
    <td width="20%" class="right_subject2"><?php echo $LANGUAGE['register_js_text_fontsize'];?></td>
    <td width="40%" class="right_content"><input type="text" name="js_text_fontsize" size="26" maxlength="6" value="12" class="input"> px</td>
    <td width="40%" class="right_content"></td>
  </tr>
  <tr>
    <td width="20%" class="right_subject2"><?php echo $LANGUAGE['register_js_text_fontcolor'];?></td>
    <td width="40%" class="right_content"><input type="text" name="js_text_fontcolor" size="26" maxlength="6" value="002280" class="input"></td>
    <td width="40%" class="right_content"><table width="30" height="18" border="0" cellpadding="0" cellspacing="0" bgcolor="#002280"><tr><td></td></tr></table></td>
  </tr>
  <tr>
    <td width="20%" class="right_subject2"><?php echo $LANGUAGE['register_js_text_fontborder'];?></td>
    <td width="40%" class="right_content"><input type="text" name="js_text_fontborder" size="26" maxlength="6" value="1" class="input"> px</td>
    <td width="40%" class="right_content"></td>
  </tr>
  <tr>
    <td width="20%" class="right_subject2"><?php echo $LANGUAGE['register_js_text_fontborder_style'];?></td>
    <td width="40%" class="right_content">
      <select name="js_text_fontborder_style" class="select">
      <option value="solid" selected><?php echo $LANGUAGE['register_js_text_fontborder_style_solid'];?></option>
      <option value="dotted"><?php echo $LANGUAGE['register_js_text_fontborder_style_dotted'];?></option>
      <option value="dashed"><?php echo $LANGUAGE['register_js_text_fontborder_style_dashed'];?></option>
      <option value="double"><?php echo $LANGUAGE['register_js_text_fontborder_style_double'];?></option>
      <option value="groove"><?php echo $LANGUAGE['register_js_text_fontborder_style_groove'];?></option>
      <option value="ridge"><?php echo $LANGUAGE['register_js_text_fontborder_style_ridge'];?></option>
      <option value="inset"><?php echo $LANGUAGE['register_js_text_fontborder_style_inset'];?></option>
      <option value="outset"><?php echo $LANGUAGE['register_js_text_fontborder_style_outset'];?></option>
      </select>
    </td>
    <td width="40%" class="right_content"></td>
  </tr>
  <tr>
    <td width="20%" class="right_subject2"><?php echo $LANGUAGE['register_js_text_fontborder_color'];?></td>
    <td width="40%" class="right_content"><input type="text" name="js_text_fontborder_color" size="26" maxlength="6" value="002280" class="input"></td>
    <td width="40%" class="right_content"><table width="30" height="18" border="0" cellpadding="0" cellspacing="0" bgcolor="#002280"><tr><td></td></tr></table></td>
  </tr>
  <tr>
    <td width="20%" class="right_subject2"><?php echo $LANGUAGE['register_js_text_fontbg_color'];?></td>
    <td width="40%" class="right_content"><input type="text" name="js_text_fontbg_color" size="26" maxlength="6" value="FFFFD7" class="input"></td>
    <td width="40%" class="right_content"><table width="30" height="18" border="0" cellpadding="0" cellspacing="0" bgcolor="#FFFFD7"><tr><td></td></tr></table></td>
  </tr>
</table>

<table width="100%" border="0" cellspacing="1" cellpadding="3" align="center" bgcolor="#FFFFFF" id="js_picture" style="display:none">
  <tr>
    <td width="20%" class="right_subject2"><?php echo $LANGUAGE['register_js_picture_style'];?></td>
    <td width="40%" class="right_content">
<?php
$file_list     = return_dir("images/js_picture/");
$total_record = count($file_list);
echo "<select name='js_picture_style' class='select' size=1 onChange='ShowJsPicture()'>";
echo "<option value='default'>default</option>";
for($i=0;$i<$total_record;$i++){
  if(trim($file_list[$i]) != "default"){
      echo "<option value='".$file_list[$i]."'>".$file_list[$i]."</option>";
  }
}
echo "</select>";
?>
    </td>
    <td width="40%" class="right_content"><?php echo sprintf($LANGUAGE['register_js_picture_style_explain'],$SETTING['dir_js_picture']);?><br><a href="JavaScript:New('image.php?act=js_picture')"><?php echo $LANGUAGE['register_js_picture_style_view'];?></a></td>
  </tr>
  <tr>
    <td colspan="3" align="center" class="right_content">
      <img src="images/js_picture/default/1.gif" name="js_picture_style_1" border=0><img src="images/js_picture/default/2.gif" name="js_picture_style_2" border=0><img src="images/js_picture/default/3.gif" name="js_picture_style_3" border=0><img src="images/js_picture/default/4.gif" name="js_picture_style_4" border=0><img src="images/js_picture/default/5.gif" name="js_picture_style_5" border=0><img src="images/js_picture/default/6.gif" name="js_picture_style_6" border=0><img src="images/js_picture/default/7.gif" name="js_picture_style_7" border=0><img src="images/js_picture/default/8.gif" name="js_picture_style_8" border=0><img src="images/js_picture/default/9.gif" name="js_picture_style_9" border=0><img src="images/js_picture/default/0.gif" name="js_picture_style_0" border=0>
    </td>
  </tr>
</table>

<table width="100%" border="0" cellspacing="1" cellpadding="3" align="center" bgcolor="#FFFFFF" id="js_icon" style="display:none">
  <tr>
    <td width="20%" class="right_subject2"><?php echo $LANGUAGE['register_js_icon_style'];?></td>
    <td width="40%" class="right_content">
<?php
$file_list     = return_dir("images/js_icon/");
$total_record = count($file_list);
echo "<select name='js_icon_style' class='select' size=1 onChange='ShowJsIcon()'>";
echo "<option value='default.gif'>default.gif</option>";
for($i=0;$i<$total_record;$i++){
   if(trim($file_list[$i]) != "default.gif"){
       echo "<option value='".$file_list[$i]."'>".$file_list[$i]."</option>";
   }
}
echo "</select>";
?>
    </td>
    <td width="40%" class="right_content"><?php echo sprintf($LANGUAGE['register_js_icon_style_explain'],$SETTING['dir_js_icon']);?><br><a href="JavaScript:New('image.php?act=js_icon')"><?php echo $LANGUAGE['register_js_icon_style_view'];?></a></td>
  </tr>
  <tr>
    <td colspan="3" align="center" class="right_content">
      <img src="images/js_icon/default.gif" name="js_icon_style" border="0">
    </td>
  </tr>
</table>

<table width="100%" border="0" cellspacing="1" cellpadding="3" align="center" bgcolor="#FFFFFF" id="js_hidden" style="display:none">
  <tr>
    <td align="center" class="right_content">
      <?php echo $LANGUAGE['register_js_hidden_style'];?>
    </td>
  </tr>
</table>

</div>
<!-- end js mode -->

<!-- begin image mode -->
<div id="image" style="display:none">
<table width="100%" border="0" cellspacing="1" cellpadding="3" align="center" bgcolor="#FFFFFF">
  <tr>
    <td width="20%" class="right_subject2"><?php echo $LANGUAGE['register_image_select'];?></td>
    <td width="40%" class="right_content">
      <select name="image_style" class="select"  onChange="for(var i=0; i<options.length; i++){eval(options[i].value).style.display=value==options[i].value?'':'none'}">
      <option value="image_custom"><?php echo $LANGUAGE['register_image_custom'];?></option>
      <option value="image_hidden"><?php echo $LANGUAGE['register_image_hidden'];?></option>
      </select>
    </td>
    <td width="40%" class="right_content"><?php echo $LANGUAGE['register_image_hidden'];?></td>
  </tr>
</table>

<table width="100%" border="0" cellspacing="1" cellpadding="3" align="center" bgcolor="#FFFFFF" id="image_custom">
  <tr>
    <td width="20%" class="right_subject2"><?php echo $LANGUAGE['register_image_custom_background'];?></td>
    <td width="40%" class="right_content">
<?php
$file_list    = return_dir("images/image_custom/");
$total_record = count($file_list);
echo "<select name='image_custom_background' class='select' size=1 onChange='ShowImageCustom()'>";
echo "<option value='default.png'>default.png</option>";
for($i=0;$i<$total_record;$i++){
   if(trim($file_list[$i]) != "default.png"){
       echo "<option value='".$file_list[$i]."'>".$file_list[$i]."</option>";
   }
}
echo "</select>";
?>
    </td>
    <td width="40%" class="right_content"><?php echo sprintf($LANGUAGE['register_image_custom_background_explain'],$SETTING['dir_image_custom']);?><br><a href="JavaScript:New('image.php?act=image_custom')"><?php echo $LANGUAGE['register_image_custom_background_view'];?></a></td>
  </tr>
  <tr>
    <td colspan="3" align="center" class="right_content">
      <img src="images/image_custom/default.png" name="image_custom_background" border="0">
    </td>
  </tr>
  <tr>
    <td width="20%" class="right_subject2"><?php echo $LANGUAGE['register_image_custom_font'];?></td>
    <td width="40%" class="right_content">
<?php
$file_list    = return_dir("fonts/");
$total_record = count($file_list);
echo "<select name='image_custom_font' class='select' size=1>";
for($i=1;$i<=5;$i++){
   echo "<option value='".$i."'>".$i."</option>";
}
for($i=0;$i<$total_record;$i++){
   $selected = (trim($file_list[$i]) == "mingliu.ttf") ? " selected" : "";
   echo "<option value='".$file_list[$i]."' ".$selected.">".$file_list[$i]."</option>";
}
echo "</select>";
?>
    </td>
    <td width="40%" class="right_content"><?php echo sprintf($LANGUAGE['register_image_custom_font_explain'],$SETTING['dir_fonts']);?></td>
  </tr>
  <tr>
    <td width="20%" class="right_subject2"><?php echo $LANGUAGE['register_image_custom_color'];?></td>
    <td width="40%" class="right_content"><input type="text" name="image_custom_color" size="26" maxlength="6" value="002280" class="input"></td>
    <td width="40%" class="right_content"><table width="30" height="18" border="0" cellpadding="0" cellspacing="0" bgcolor="#002280"><tr><td></td></tr></table></td>
  </tr>
  <tr>
    <td width="20%" class="right_subject2"><?php echo $LANGUAGE['register_image_custom_size'];?></td>
    <td width="40%" class="right_content"><input type="text" name="image_custom_size" size="26" maxlength="3" value="9" class="input"> pt</td>
    <td width="40%" class="right_content"><?php echo $LANGUAGE['register_image_custom_size_explain'];?></td>
  </tr>
  <tr>
    <td width="20%" class="right_subject2"><?php echo $LANGUAGE['register_image_custom_top'];?></td>
    <td width="40%" class="right_content"><input type="text" name="image_custom_top" size="26" maxlength="3" value="4" class="input"></td>
    <td width="40%" class="right_content"></td>
  </tr>
  <tr>
    <td width="20%" class="right_subject2"><?php echo $LANGUAGE['register_image_custom_left'];?></td>
    <td width="40%" class="right_content"><input type="text" name="image_custom_left" size="26" maxlength="3" value="3" class="input"></td>
    <td width="40%" class="right_content"></td>
  </tr>
  <tr>
    <td width="20%" class="right_subject2"><?php echo $LANGUAGE['register_image_custom_rowspacing'];?></td>
    <td width="40%" class="right_content"><input type="text" name="image_custom_rowspacing" size="26" maxlength="3" value="0" class="input"></td>
    <td width="40%" class="right_content"><?php echo $LANGUAGE['register_image_custom_rowspacing_explain'];?></td>
  </tr>
  <tr>
    <td width="20%" class="right_subject2"><?php echo $LANGUAGE['register_image_custom_width'];?></td>
    <td width="40%" class="right_content"><input type="text" name="image_custom_width" size="26" maxlength="3" value="330" class="input"></td>
    <td width="40%" class="right_content"></td>
  </tr>
  <tr>
    <td width="20%" class="right_subject2"><?php echo $LANGUAGE['register_image_custom_height'];?></td>
    <td width="40%" class="right_content"><input type="text" name="image_custom_height" size="26" maxlength="3" value="18" class="input"></td>
    <td width="40%" class="right_content"></td>
  </tr>
</table>

<table width="100%" border="0" cellspacing="1" cellpadding="3" align="center" bgcolor="#FFFFFF" id="image_hidden" style="display:none">
  <tr>
    <td align="center" class="right_content">
      <?php echo $LANGUAGE['register_image_hidden_style'];?>
    </td>
  </tr>
</table>

</div>
<!-- end image mode -->

<table width="100%" border="0" cellspacing="1" cellpadding="3" align="center" bgcolor="#FFFFFF">
<tr><td align="center" class="right_footer"><input type="submit" value="<?php echo $LANGUAGE['register_image_submit']?>" name="submit" class="submit"> <input type="reset" value="<?php echo $LANGUAGE['register_image_reset']?>" name="reset" class="submit"></td></tr>
</table>

</td></tr></form></table>

<?php
}elseif($_GET['act'] == "save") {

$user               = $_POST['username'];
$userdir            = $SETTING['dir_data'].$user;

$file_config        = $userdir."/".$SETTING['file_config'];
$file_ipsame        = $userdir."/".$SETTING['file_ipsame'];

$file_click         = $userdir."/".$SETTING['file_click'];

$file_totalmonth    = $userdir."/".$SETTING['file_totalmonth'];
$file_totalday      = $userdir."/".$SETTING['file_totalday'];
$file_totalhour     = $userdir."/".$SETTING['file_totalhour'];

$file_year          = $userdir."/".$SETTING['file_year'];
$file_month         = $userdir."/".$SETTING['file_month'];
$file_day           = $userdir."/".$SETTING['file_day'];
$file_hour          = $userdir."/".$SETTING['file_hour'];

$file_online        = $userdir."/".$SETTING['file_online'];
$file_visitor       = $userdir."/".$SETTING['file_visitor'];

$file_os            = $userdir."/".$SETTING['file_os'];
$file_browser       = $userdir."/".$SETTING['file_browser'];
$file_language      = $userdir."/".$SETTING['file_language'];
$file_colordepth    = $userdir."/".$SETTING['file_colordepth'];
$file_screensize    = $userdir."/".$SETTING['file_screensize'];
$file_timezone      = $userdir."/".$SETTING['file_timezone'];

$file_searchfrom    = $userdir."/".$SETTING['file_searchfrom'];
$file_searchkeyword = $userdir."/".$SETTING['file_searchkeyword'];

if(file_exists($file_config)){
   header("location:prompt.php?act=failed&mes=".htmlentities(urlencode($LANGUAGE['register_warning_already_user'])));
   exit;
}
if($user == "" || $_POST['password1'] == "" || $_POST['password2'] == "" || $_POST['email'] == "" || $_POST['website'] == "" || $_POST['weburl'] == "" || $_POST['weburl'] == "http://" || $_POST['webintro'] == "" || $_POST['length'] == "" || $_POST['ifview'] == "" || $_POST['ifadd0'] == "" || $_POST['language'] == ""){
   header("location:prompt.php?act=failed&mes=".htmlentities(urlencode($LANGUAGE['register_warning_empty'])));
   exit;
}
if($_POST['password1'] != $_POST['password2']){
   header("location:prompt.php?act=failed&mes=".htmlentities(urlencode($LANGUAGE['register_warning_pass_differ'])));
   exit;
}
if(!preg_match("/^[0-9a-z_]{3,60}$/",$user)){
   header("location:prompt.php?act=failed&mes=".htmlentities(urlencode($LANGUAGE['register_warning_user_error'])));
   exit;
}
if(!preg_match("/^[0-9a-z_]{3,60}$/i",$_POST['password1'])){
   header("location:prompt.php?act=failed&mes=".htmlentities(urlencode($LANGUAGE['register_warning_password_error'])));
   exit;
}
if(!preg_match("/^[_.0-9a-z-]+@([0-9a-z][0-9a-z-]+\.)+[a-z]{2,3}$/i",$_POST['email'])){
   header("location:prompt.php?act=failed&mes=".htmlentities(urlencode($LANGUAGE['register_warning_email_error'])));
   exit;
}
if(strlen($_POST['webintro']) > CONFIG_WEBINTRO_LONG){
   header("location:prompt.php?act=failed&mes=".htmlentities(urlencode(sprintf($LANGUAGE['register_warning_webintro_error'],CONFIG_WEBINTRO_LONG))));
   exit;
}
if(!preg_match("/^[0-9]{1,2}$/",$_POST['length'])){
   header("location:prompt.php?act=failed&mes=".htmlentities(urlencode($LANGUAGE['register_warning_length_error'])));
   exit;
}
if(($_POST['timediff'] <= -24) || ($_POST['timediff'] >= 24)){
   header("location:prompt.php?act=failed&mes=".htmlentities(urlencode($LANGUAGE['register_warning_timediff_error'])));
   exit;
}

if( ($_POST['mode'] == "js") && ($_POST['js_style'] == "text") ){
   if(!preg_match("/^[0-9]{1,6}$/",$_POST['js_text_fontsize'])){
      header("location:prompt.php?act=failed&mes=".htmlentities(urlencode($LANGUAGE['register_warning_js_text_fontsize_error'])));
      exit;
   }
   if(!preg_match("/^[0-9a-f]{6,6}$/i",$_POST['js_text_fontcolor'])){
      header("location:prompt.php?act=failed&mes=".htmlentities(urlencode($LANGUAGE['register_warning_js_text_fontcolor_error'])));
      exit;
   }
   if(!preg_match("/^[0-9]{1,6}$/",$_POST['js_text_fontborder'])){
      header("location:prompt.php?act=failed&mes=".htmlentities(urlencode($LANGUAGE['register_warning_js_text_fontborder_error'])));
      exit;
   }
   if(!preg_match("/^[0-9a-f]{6,6}$/i",$_POST['js_text_fontborder_color'])){
      header("location:prompt.php?act=failed&mes=".htmlentities(urlencode($LANGUAGE['register_warning_js_text_fontborder_color_error'])));
      exit;
   }
   if(!preg_match("/^[0-9a-f]{6,6}$/i",$_POST['js_text_fontbg_color'])){
      header("location:prompt.php?act=failed&mes=".htmlentities(urlencode($LANGUAGE['register_warning_js_text_fontbg_color_error'])));
      exit;
   }
}

if( ($_POST['mode'] == "image") && ($_POST['image_style'] == "custom") ){
   if(!preg_match("/^[0-9a-z_.]{4,60}$/i",$_POST['image_custom_font'])){
      header("location:prompt.php?act=failed&mes=".htmlentities(urlencode($LANGUAGE['register_warning_image_custom_font_error'])));
      exit;
   }
   if(!preg_match("/^[0-9a-f]{6,6}$/i",$_POST['image_custom_color'])){
      header("location:prompt.php?act=failed&mes=".htmlentities(urlencode($LANGUAGE['register_warning_image_custom_color_error'])));
      exit;
   }
   if(!preg_match("/^[0-9]{1,3}$/",$_POST['image_custom_size'])){
      header("location:prompt.php?act=failed&mes=".htmlentities(urlencode($LANGUAGE['register_warning_image_custom_size_error'])));
      exit;
   }
   if(!preg_match("/^[0-9]{1,3}$/",$_POST['image_custom_top'])){
      header("location:prompt.php?act=failed&mes=".htmlentities(urlencode($LANGUAGE['register_warning_image_custom_top_error'])));
      exit;
   }
   if(!preg_match("/^[0-9]{1,3}$/",$_POST['image_custom_left'])){
      header("location:prompt.php?act=failed&mes=".htmlentities(urlencode($LANGUAGE['register_warning_image_custom_left_error'])));
      exit;
   }
   if(!preg_match("/^[0-9]{1,3}$/",$_POST['image_custom_rowspacing'])){
      header("location:prompt.php?act=failed&mes=".htmlentities(urlencode($LANGUAGE['register_warning_image_custom_rowspacing_error'])));
      exit;
   }
   if(!preg_match("/^[0-9]{1,3}$/",$_POST['image_custom_width'])){
      header("location:prompt.php?act=failed&mes=".htmlentities(urlencode($LANGUAGE['register_warning_image_custom_width_error'])));
      exit;
   }
   if(!preg_match("/^[0-9]{1,3}$/",$_POST['image_custom_height'])){
      header("location:prompt.php?act=failed&mes=".htmlentities(urlencode($LANGUAGE['register_warning_image_custom_height_error'])));
      exit;
   }
}

$timediff        = $_POST['timediff']*3600;
    
$website         = str_encode($_POST['website']);
$weburl          = str_encode($_POST['weburl']);
$webintro        = str_encode($_POST['webintro']);

$total_ip_text   = str_encode($_POST['total_ip_text']);
$total_pv_text   = str_encode($_POST['total_pv_text']);
$year_ip_text    = str_encode($_POST['year_ip_text']);
$year_pv_text    = str_encode($_POST['year_pv_text']);
$month_ip_text   = str_encode($_POST['month_ip_text']);
$month_pv_text   = str_encode($_POST['month_pv_text']);
$day_ip_text     = str_encode($_POST['day_ip_text']);
$day_pv_text     = str_encode($_POST['day_pv_text']);
$online_text     = str_encode($_POST['online_text']);

$js_text_fontfamily       = "font-family:".$_POST['js_text_fontfamily'].";";
$js_text_fontsize         = (!preg_match("/^[0-9]{1,6}$/",$_POST['js_text_fontsize'])) ? "font-size:12;" : "font-size:".$_POST['js_text_fontsize'].";";
$js_text_fontcolor        = (!preg_match("/^[0-9a-f]{6,6}$/i",$_POST['js_text_fontcolor'])) ? "color:#000000;" : "color:#".$_POST['js_text_fontcolor'].";";
$js_text_fontborder       = (!preg_match("/^[0-9]{1,6}$/",$_POST['js_text_fontborder'])) ? "border:1px" : "border:".$_POST['js_text_fontborder']."px";
$js_text_fontborder_style = " ".$_POST['js_text_fontborder_style'];
$js_text_fontborder_color = (!preg_match("/^[0-9a-f]{6,6}$/i",$_POST['js_text_fontborder_color'])) ? " #000000;" : " #".$_POST['js_text_fontborder_color'].";";
$js_text_fontbg_color     = (!preg_match("/^[0-9a-f]{6,6}$/i",$_POST['js_text_fontbg_color'])) ? "background-color:#FFFFD7;" : "background-color:#".$_POST['js_text_fontbg_color'].";";

$image_custom_color       = (!preg_match("/^[0-9a-f]{6,6}$/i",$_POST['image_custom_color'])) ? "002280" : $_POST['image_custom_color'];
$image_custom_size        = (!preg_match("/^[0-9]{1,6}$/",$_POST['image_custom_size'])) ? "9" : $_POST['image_custom_size'];
$image_custom_top         = (!preg_match("/^[0-9]{1,6}$/",$_POST['image_custom_top'])) ? "4" : $_POST['image_custom_top'];
$image_custom_left        = (!preg_match("/^[0-9]{1,6}$/",$_POST['image_custom_left'])) ? "3" : $_POST['image_custom_left'];
$image_custom_rowspacing  = (!preg_match("/^[0-9]{1,3}$/",$_POST['image_custom_rowspacing'])) ? "0" : $_POST['image_custom_rowspacing'];
$image_custom_width       = (!preg_match("/^[0-9]{1,6}$/",$_POST['image_custom_width'])) ? "330" : $_POST['image_custom_width'];
$image_custom_height      = (!preg_match("/^[0-9]{1,6}$/",$_POST['image_custom_height'])) ? "18" : $_POST['image_custom_height'];

$user_config = "<?php
####################################### User Info #################################################
\$CONFIGUSER['username']                 = '".$user."';// Username
\$CONFIGUSER['password']                 = '".str_encrypt($_POST['password1'])."';// Password

\$CONFIGUSER['email']                    = '".$_POST['email']."';// E-mail
\$CONFIGUSER['website']                  = '".$website."';// Website name
\$CONFIGUSER['weburl']                   = '".$weburl."';// Website url
\$CONFIGUSER['webintro']                 = '".$webintro."';// Website intro

####################################### Option ####################################################
\$CONFIGUSER['length']                   = '".$_POST['length']."';// Length
\$CONFIGUSER['timediff']                 = '".$timediff."';// Time difference
\$CONFIGUSER['ifview']                   = '".$_POST['ifview']."';// Allow other people view
\$CONFIGUSER['ifadd0']                   = '".$_POST['ifadd0']."';// If leading zeros
\$CONFIGUSER['language']                 = '".$_POST['language']."';// Language

####################################### Register Info #############################################
\$CONFIGUSER['begintime']                = '".time()."';// What time i begin to stat.

####################################### Display Option ############################################
\$CONFIGUSER['total_ip_if']              = '".$_POST['total_ip_if']."';// If show total ip
\$CONFIGUSER['total_ip_text']            = '".$total_ip_text."';// Text of total ip
\$CONFIGUSER['total_pv_if']              = '".$_POST['total_pv_if']."';// If show total pv
\$CONFIGUSER['total_pv_text']            = '".$total_pv_text."';// Text of total pv

\$CONFIGUSER['year_ip_if']               = '".$_POST['year_ip_if']."';// If show year ip
\$CONFIGUSER['year_ip_text']             = '".$year_ip_text."';// Text of year ip
\$CONFIGUSER['year_pv_if']               = '".$_POST['year_pv_if']."';// If show year pv
\$CONFIGUSER['year_pv_text']             = '".$year_pv_text."';// Text of year pv

\$CONFIGUSER['month_ip_if']              = '".$_POST['month_ip_if']."';// If show month ip
\$CONFIGUSER['month_ip_text']            = '".$month_ip_text."';// Text of month ip
\$CONFIGUSER['month_pv_if']              = '".$_POST['month_pv_if']."';// If show month pv
\$CONFIGUSER['month_pv_text']            = '".$month_pv_text."';// Text of month pv

\$CONFIGUSER['day_ip_if']                = '".$_POST['day_ip_if']."';// If show day ip
\$CONFIGUSER['day_ip_text']              = '".$day_ip_text."';// Text of day ip
\$CONFIGUSER['day_pv_if']                = '".$_POST['day_pv_if']."';// If show day pv
\$CONFIGUSER['day_pv_text']              = '".$day_pv_text."';// Text of day pv

\$CONFIGUSER['online_if']                = '".$_POST['online_if']."';// If show online
\$CONFIGUSER['online_text']              = '".$online_text."';// Text of online

####################################### Display Mode [js|image] ###################################
\$CONFIGUSER['mode']                     = '".$_POST['mode']."';

//===================================== Mode = js =================================================
// js = [js_text|js_picture|js_icon|js_hidden]
\$CONFIGUSER['js_style']                 = '".$_POST['js_style']."';
# js_text
\$CONFIGUSER['js_text_fontfamily']       = '".$js_text_fontfamily."';// Font
\$CONFIGUSER['js_text_fontsize']         = '".$js_text_fontsize."';// Font size
\$CONFIGUSER['js_text_fontcolor']        = '".$js_text_fontcolor."';// Font color
\$CONFIGUSER['js_text_fontborder']       = '".$js_text_fontborder."';// Font border
\$CONFIGUSER['js_text_fontborder_style'] = '".$js_text_fontborder_style."';// Font border style
\$CONFIGUSER['js_text_fontborder_color'] = '".$js_text_fontborder_color."';// Font border color
\$CONFIGUSER['js_text_fontbg_color']     = '".$js_text_fontbg_color."';// Background color
# js_picture
\$CONFIGUSER['js_picture_style']         = '".$_POST['js_picture_style']."';// The style of picture
# js_icon
\$CONFIGUSER['js_icon_style']            = '".$_POST['js_icon_style']."';// The style of icon
# js_hidden

//===================================== Mode = image ==============================================
// image = [image_custom|image_hidden]
\$CONFIGUSER['image_style']              = '".$_POST['image_style']."';
# image_custom
\$CONFIGUSER['image_custom_background']  = '".$_POST['image_custom_background']."';// Put the background picture into /images/image_custom/
\$CONFIGUSER['image_custom_font']        = '".$_POST['image_custom_font']."';// Put the font into dir of /fonts/.1,2,3,4,5 is built-in font
\$CONFIGUSER['image_custom_color']       = '".$image_custom_color."';// The color of text
\$CONFIGUSER['image_custom_size']        = '".$image_custom_size."';// Font size
\$CONFIGUSER['image_custom_top']         = '".$image_custom_top."';// Interval top of text
\$CONFIGUSER['image_custom_left']        = '".$image_custom_left."';// Interval left of text
\$CONFIGUSER['image_custom_rowspacing']  = '".$image_custom_rowspacing."';// Interval row spacing of text
\$CONFIGUSER['image_custom_width']       = '".$image_custom_width."';// Background width
\$CONFIGUSER['image_custom_height']      = '".$image_custom_height."';// Background height
# image_hidden
?>
";
?>

<table width="100%" border="0" cellspacing="0" cellpadding="3" align="center"><tr><td><img src="images/arrowright.gif" border=0 align="absmiddle"> <a href="index.php" target="_self"><font style="color:#000000;"><?php echo CONFIG_WEBSITE;?></font></a> &raquo; <?php echo $LANGUAGE['register_place'];?></td></tr></table>
<br>
<table width="95%" border="0" cellspacing="1" cellpadding="3" align="center" bgcolor="#FFFFFF">
<tr><td height="25">

<?php
$ifok = "yes";

$str  = "<?php exit(\"".$SETTING['cannotview']."\");?>\n";

$str_click  = $str;
$str_click .= $array_click[0].$SETTING['division1']."0".$SETTING['division1']."0"."\n";
$str_click .= $array_click[1].$SETTING['division1']."0".$SETTING['division1']."0"."\n";
$str_click .= $array_click[2].$SETTING['division1']."0".$SETTING['division1']."0"."\n";
$str_click .= $array_click[3].$SETTING['division1']."0".$SETTING['division1']."0"."\n";

if(is_dir($userdir)){
   if(@chmod($userdir,0777)){
       echo "&raquo; ".$LANGUAGE['register_dir_chmod']." ...... <font class=\"succeed\">".$LANGUAGE['register_succeed']."</font><br>";
   }else{
       $ifok = "no";echo "&raquo; ".$LANGUAGE['register_dir_chmod']." ...... <font class=\"failed\">".$LANGUAGE['register_failed']."</font><br>";
   }
}else{
   if(@mkdir($userdir,0777)){
       echo "&raquo; ".$LANGUAGE['register_dir_mkdir']." ...... <font class=\"succeed\">".$LANGUAGE['register_succeed']."</font><br>";
   }else{
       $ifok = "no";echo "&raquo; ".$LANGUAGE['register_dir_mkdir']." ...... <font class=\"failed\">".$LANGUAGE['register_failed']."</font><br>";
   }
}

if(write_file($file_config,$user_config)) {echo "&raquo; ".$LANGUAGE['register_make']." ".$SETTING['file_config']." ...... <font class=\"succeed\">".$LANGUAGE['register_succeed']."</font><br>";         }else{$ifok = "no";echo "&raquo; ".$LANGUAGE['register_make']." ".$SETTING['file_config']." ...... <font class=\"failed\">".$LANGUAGE['register_failed']."</font><br>";}
if(write_file($file_ipsame,$str))         {echo "&raquo; ".$LANGUAGE['register_make']." ".$SETTING['file_ipsame']." ...... <font class=\"succeed\">".$LANGUAGE['register_succeed']."</font><br>";         }else{$ifok = "no";echo "&raquo; ".$LANGUAGE['register_make']." ".$SETTING['file_ipsame']." ...... <font class=\"failed\">".$LANGUAGE['register_failed']."</font><br>";}

if(write_file($file_click,$str_click))    {echo "&raquo; ".$LANGUAGE['register_make']." ".$SETTING['file_click']." ...... <font class=\"succeed\">".$LANGUAGE['register_succeed']."</font><br>";          }else{$ifok = "no";echo "&raquo; ".$LANGUAGE['register_make']." ".$SETTING['file_click']." ...... <font class=\"failed\">".$LANGUAGE['register_failed']."</font><br>";}

if(write_file($file_totalmonth,$str))     {echo "&raquo; ".$LANGUAGE['register_make']." ".$SETTING['file_totalmonth']." ...... <font class=\"succeed\">".$LANGUAGE['register_succeed']."</font><br>";     }else{$ifok = "no";echo "&raquo; ".$LANGUAGE['register_make']." ".$SETTING['file_totalmonth']." ...... <font class=\"failed\">".$LANGUAGE['register_failed']."</font><br>";}
if(write_file($file_totalday,$str))       {echo "&raquo; ".$LANGUAGE['register_make']." ".$SETTING['file_totalday']." ...... <font class=\"succeed\">".$LANGUAGE['register_succeed']."</font><br>";       }else{$ifok = "no";echo "&raquo; ".$LANGUAGE['register_make']." ".$SETTING['file_totalday']." ...... <font class=\"failed\">".$LANGUAGE['register_failed']."</font><br>";}
if(write_file($file_totalhour,$str))      {echo "&raquo; ".$LANGUAGE['register_make']." ".$SETTING['file_totalhour']." ...... <font class=\"succeed\">".$LANGUAGE['register_succeed']."</font><br>";      }else{$ifok = "no";echo "&raquo; ".$LANGUAGE['register_make']." ".$SETTING['file_totalhour']." ...... <font class=\"failed\">".$LANGUAGE['register_failed']."</font><br>";}

if(write_file($file_year,$str))           {echo "&raquo; ".$LANGUAGE['register_make']." ".$SETTING['file_year']." ...... <font class=\"succeed\">".$LANGUAGE['register_succeed']."</font><br>";           }else{$ifok = "no";echo "&raquo; ".$LANGUAGE['register_make']." ".$SETTING['file_year']." ...... <font class=\"failed\">".$LANGUAGE['register_failed']."</font><br>";}
if(write_file($file_month,$str))          {echo "&raquo; ".$LANGUAGE['register_make']." ".$SETTING['file_month']." ...... <font class=\"succeed\">".$LANGUAGE['register_succeed']."</font><br>";          }else{$ifok = "no";echo "&raquo; ".$LANGUAGE['register_make']." ".$SETTING['file_month']." ...... <font class=\"failed\">".$LANGUAGE['register_failed']."</font><br>";}
if(write_file($file_day,$str))            {echo "&raquo; ".$LANGUAGE['register_make']." ".$SETTING['file_day']." ...... <font class=\"succeed\">".$LANGUAGE['register_succeed']."</font><br>";            }else{$ifok = "no";echo "&raquo; ".$LANGUAGE['register_make']." ".$SETTING['file_day']." ...... <font class=\"failed\">".$LANGUAGE['register_failed']."</font><br>";}
if(write_file($file_hour,$str))           {echo "&raquo; ".$LANGUAGE['register_make']." ".$SETTING['file_hour']." ...... <font class=\"succeed\">".$LANGUAGE['register_succeed']."</font><br>";           }else{$ifok = "no";echo "&raquo; ".$LANGUAGE['register_make']." ".$SETTING['file_hour']." ...... <font class=\"failed\">".$LANGUAGE['register_failed']."</font><br>";}

if(write_file($file_online,$str))         {echo "&raquo; ".$LANGUAGE['register_make']." ".$SETTING['file_online']." ...... <font class=\"succeed\">".$LANGUAGE['register_succeed']."</font><br>";         }else{$ifok = "no";echo "&raquo; ".$LANGUAGE['register_make']." ".$SETTING['file_online']." ...... <font class=\"failed\">".$LANGUAGE['register_failed']."</font><br>";}
if(write_file($file_visitor,$str))        {echo "&raquo; ".$LANGUAGE['register_make']." ".$SETTING['file_visitor']." ...... <font class=\"succeed\">".$LANGUAGE['register_succeed']."</font><br>";        }else{$ifok = "no";echo "&raquo; ".$LANGUAGE['register_make']." ".$SETTING['file_visitor']." ...... <font class=\"failed\">".$LANGUAGE['register_failed']."</font><br>";}

if(write_file($file_os,$str))             {echo "&raquo; ".$LANGUAGE['register_make']." ".$SETTING['file_os']." ...... <font class=\"succeed\">".$LANGUAGE['register_succeed']."</font><br>";             }else{$ifok = "no";echo "&raquo; ".$LANGUAGE['register_make']." ".$SETTING['file_os']." ...... <font class=\"failed\">".$LANGUAGE['register_failed']."</font><br>";}
if(write_file($file_browser,$str))        {echo "&raquo; ".$LANGUAGE['register_make']." ".$SETTING['file_browser']." ...... <font class=\"succeed\">".$LANGUAGE['register_succeed']."</font><br>";        }else{$ifok = "no";echo "&raquo; ".$LANGUAGE['register_make']." ".$SETTING['file_browser']." ...... <font class=\"failed\">".$LANGUAGE['register_failed']."</font><br>";}
if(write_file($file_language,$str))       {echo "&raquo; ".$LANGUAGE['register_make']." ".$SETTING['file_language']." ...... <font class=\"succeed\">".$LANGUAGE['register_succeed']."</font><br>"; }else{$ifok = "no";echo "&raquo; ".$LANGUAGE['register_make']." ".$SETTING['file_language']." ...... <font class=\"failed\">".$LANGUAGE['register_failed']."</font><br>";}
if(write_file($file_colordepth,$str))     {echo "&raquo; ".$LANGUAGE['register_make']." ".$SETTING['file_colordepth']." ...... <font class=\"succeed\">".$LANGUAGE['register_succeed']."</font><br>";     }else{$ifok = "no";echo "&raquo; ".$LANGUAGE['register_make']." ".$SETTING['file_colordepth']." ...... <font class=\"failed\">".$LANGUAGE['register_failed']."</font><br>";}
if(write_file($file_screensize,$str))     {echo "&raquo; ".$LANGUAGE['register_make']." ".$SETTING['file_screensize']." ...... <font class=\"succeed\">".$LANGUAGE['register_succeed']."</font><br>";     }else{$ifok = "no";echo "&raquo; ".$LANGUAGE['register_make']." ".$SETTING['file_screensize']." ...... <font class=\"failed\">".$LANGUAGE['register_failed']."</font><br>";}
if(write_file($file_timezone,$str))       {echo "&raquo; ".$LANGUAGE['register_make']." ".$SETTING['file_timezone']." ...... <font class=\"succeed\">".$LANGUAGE['register_succeed']."</font><br>";       }else{$ifok = "no";echo "&raquo; ".$LANGUAGE['register_make']." ".$SETTING['file_timezone']." ...... <font class=\"failed\">".$LANGUAGE['register_failed']."</font><br>";}

if(write_file($file_searchfrom,$str))     {echo "&raquo; ".$LANGUAGE['register_make']." ".$SETTING['file_searchfrom']." ...... <font class=\"succeed\">".$LANGUAGE['register_succeed']."</font><br>";     }else{$ifok = "no";echo "&raquo; ".$LANGUAGE['register_make']." ".$SETTING['file_searchfrom']." ...... <font class=\"failed\">".$LANGUAGE['register_failed']."</font><br>";}
if(write_file($file_searchkeyword,$str))  {echo "&raquo; ".$LANGUAGE['register_make']." ".$SETTING['file_searchkeyword']." ...... <font class=\"succeed\">".$LANGUAGE['register_succeed']."</font><br>";  }else{$ifok = "no";echo "&raquo; ".$LANGUAGE['register_make']." ".$SETTING['file_searchkeyword']." ...... <font class=\"failed\">".$LANGUAGE['register_failed']."</font><br>";}

if($ifok=="yes"){
   if($_POST['mode'] == "js"){
       $quote_code = "<script src=\"".CONFIG_URL."stats.php?user=".$_POST['username']."\"></script>";
   }else{
       $quote_code = "<a href=\"".CONFIG_URL."login.php?user=".$_POST['username']."\" target=\"_blank\"><img src=\"".CONFIG_URL."stats.php?user=".$_POST['username']."\" border=\"0\"></a>";
   }

   echo "<div align='center'>";
   echo "<hr width='100%' size='1' noshade color='#C0C0C0'>";
   echo "<font class='succeed'>".$LANGUAGE['register_user_succeed']."</font><br>";
   echo "<input type='button' value='".$LANGUAGE['register_copyto']."' onClick=\"CopyTo('code')\" class='submit'><br><textarea rows=3 cols=60 name='code' class='textarea'>".$quote_code."</textarea>";
   echo "<hr width='100%' size='1' noshade color='#C0C0C0'>";
   echo "<font class='succeed'>".$LANGUAGE['register_user_succeed_explain']."</font><br>";
   echo "<a href='".CONFIG_URL."login.php?user=".$_POST['username']."' target=_blank>".CONFIG_URL."login.php?user=".$_POST['username']."</a>";
   echo "<hr width='100%' size='1' noshade color='#C0C0C0'>";
   echo "</div>";
}else{
   echo "<div align='center'>";
   echo "<hr width='100%' size='1' noshade color='#C0C0C0'>";
   echo "<font class='failed'>".sprintf($LANGUAGE['register_user_failed'],CONFIG_EMAIL)."</font>";
   echo "</div>";
}
echo "</td></tr></table>";

}

echo "<br></td></tr></table>";
include_once 'include/footer.php';
?>
